//
//  STOrderPageView.swift
//  iPhone
//
//  Created by Toj on 11/24/22.
//

import UIKit

class STOrderPageView: UIView {
    var index: Int = 0
    
    @objc private func push() {
        let vc = UIViewController()
        vc.view.backgroundColor = UIColor.white
        vc.hidesBottomBarWhenPushed = true
        UIViewController.vc_currentNavigation?.pushViewController(vc, animated: true)
    }
    
    private(set) lazy var button: UIButton = {
        let view = UIButton()
        view.setTitle("点击我进行push", for: .normal)
        view.addTarget(self, action: #selector(push), for: .touchUpInside)
        view.setTitleColor(UIColor.black, for: .normal)
        view.backgroundColor = UIColor.white
        return view
    }()

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .random
        addSubview(button)
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        button.snp.makeConstraints { (maker) in
            maker.center.equalToSuperview()
        }
    }
}
